<!-- Start login -->
<section id="login">
    <div class="page-head">
        <div class="container">
            <div class="row">
                <div class="span9 head-text">
                    <h3><i class="icon-user"></i>Change Password</h3>                    
                </div>
            </div>
        </div>			
    </div>
    <div class="container">
        <div class="page-section">
            <div class="row">
                <div class="span5 frm_login" >
                    <?php echo $this->element('message'); ?>
                    <form class="form-horizontal" action="" method="post" enctype="multipart/form-data" id="form">
                        <div class="control-group">
                            <label class="control-label" for="password1">New Password</label>
                            <div class="controls">
                                <input type="password" name="password" placeholder="Password" id="password1" rerequired="required"/>
                            </div>
                        </div>
                        
                        <div class="control-group">
                            <label class="control-label" for="password2">Retype New Password</label>
                            <div class="controls">
                                <input type="password" name="password2" placeholder="Retype Password" required="required"/>
                            </div>
                        </div>
                        
                        <div class="control-group">
                            <div class="controls">                                
                                <button type="submit" class="btn">Submit</button>
                            </div>
                        </div>
                    </form>

                </div>				
            </div>
        </div>
    </div>
</section>
<!-- End about -->

<script>
// Form validation code will come here.
    $(document).ready(function(e) {

        $("#form").validate({
            rules: {   
                cpassword: {
                    required: true,
                    minlength: 7
                },
                password: {
                    required: true,
                    minlength: 7
                },
                password2: {
                    required: true,
                    minlength: 7,
                    equalTo: "#password1"
                }                
            },
            messages: {
                password: {
                    cpassword: "Please provide a password",
                    minlength: "Your password must be at least 7 characters long"
                },
                password: {
                    required: "Please provide a password",
                    minlength: "Your password must be at least 7 characters long"
                },
                password2: {
                    required: "Please provide a password",
                    minlength: "Your password must be at least 7 characters long",
                    equalTo: "Please enter the same password as above"
                }
            }
        });

    });
</script>
